<template>
  <!--首页链接-->
  <ul class="web-home-links clearfix">
    <li
      class="item"
      v-for="(v) in linkArr"
      :key="v.url">
      <a
        class="w-hover-text"
        target="_blank"
        :href="v.link">{{ v.title }}</a>
    </li>
  </ul>
</template>

<script>
import HomeLinkModel from "@/models/HomeLinksModel"
import API from '@/api/apis'
export default {
  name: "WebHomeLinks",
  data() {
    return {
      linkArr: []
    };
  },
  mounted() {
    this.getModels();
  },
  methods: {
    getModels() {
      // 获取所有数据
      HomeLinkModel.loadAllModels(API.homeLink.all).then(arr => {
        this.linkArr = arr;
      });
    }
  }
};
</script>

<style lang="scss" scoped>
.web-home-links {
  list-style: none;
  padding: 0;
  margin: 0;
  > .item {
    float: left;
    padding: 5px 10px;
    a {
      color: #999;
      font-size: 26px;
      line-height: 38px;
    }
    .hover-text:hover {
      color: #333;
    }
  }
}
</style>
